package com.atguigu06._final;

/**
 * ClassName: finalTest
 * Package: com.atguigu06._final
 * Description:
 *
 * @Author ZY
 * @Create 22:39
 * @Version 1.0
 */
public class finalTest {
    public static void main(String[] args) {

        E e = new E();
        System.out.println(e.MIN_SCORE);
//        e.MIN_SCORE= 1;

        E e2 = new E(10);


    }
}

final class A{
}

//不能继承A类
//class B extends A{
//
//}

//class SubString extends String{}

class C{
    public final void method1(){
    }
}

//不能重写final定义的方法
//class D extends C{
//    public void method1(){
//
//    }
//}

class E{
    //成员变量
    final int MIN_SCORE = 0;//1.显示赋值
    final int MAX_SCORE;

    final int LEFT;
//    final int RIGHT;

    {
//        MIN_SCORE = 1;
        MAX_SCORE = 100;//2.代码块中赋值
    }

    public E(){
        LEFT = 2;//3.构造器中赋值
    }
    public E(int left){
        LEFT = left;
    }

//    public void setRIGHT(int right){
//        RIGHT = right;
//    }
}

class F{
    public void method(){
        final int num;
        num = 10;
        System.out.println(num);
    }
    public void method(final int num){
//        num++; //不能对final定义的形参(局部变量)赋值
        System.out.println(num);
    }
}
